@echo off
chcp 65001 >nul
echo ====================================
echo   编译管理后台前端
echo ====================================
echo.

cd admin-frontend

if not exist "node_modules" (
    echo [提示] 安装依赖中...
    call pnpm install
    if %errorlevel% neq 0 (
        echo [错误] 依赖安装失败
        pause
        exit /b 1
    )
)

echo [信息] 开始编译...
call pnpm run build

if %errorlevel% equ 0 (
    echo.
    echo [成功] 编译完成！输出目录: admin-frontend/dist
) else (
    echo.
    echo [错误] 编译失败
)

cd ..
pause

